package com.wxy.demo.dao;

import com.wxy.demo.entity.Student;
import com.wxy.demo.entity.User;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author wxy
 * @Date 19-8-19 上午10:02
 * @Description TODO
 **/
@Repository
public interface StudentRepository extends JpaRepository<Student, Long>, JpaSpecificationExecutor<Student> {
    List<Student> findAllByNameLike(String name);

    List<Student> findAllByNameLike(String name, Pageable pageable);

    List<Student> findAllByNameLike(String name, Sort sort);

    Student findTopByOrderBySortDesc();
}